home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWStream / FWStrmRW.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  23.2 KB  |  776 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWStrmRW.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWSTRMRW_H
  11. #define FWSTRMRW_H
  12.  
  13. #ifndef FWODEXCE_H
  14. #include "FWODExce.h"
  15. #endif
  16.  
  17. #ifndef SLSTRMRW_H
  18. #include "SLStrmRW.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Constants
  23. //========================================================================================
  24.  
  25. // These values influence how numbers are written/read to/from streams.  The default is 
  26. // to use the native format.  
  27.  
  28. const int FW_kStream_NativeEndian = 0;
  29. const int FW_kStream_LittleEndian = 1;
  30. const int FW_kStream_BigEndian    = 2;
  31.  
  32.  
  33. //========================================================================================
  34. //    CLASS FW_CReadableStream
  35. //========================================================================================
  36.  
  37. class FW_CReadableStream : public FW_SReadableStream
  38. {
  39. public:
  40.  
  41.     FW_DECLARE_AUTO(FW_CReadableStream)
  42.  
  43.     FW_CReadableStream(FW_OSink* sink,
  44.                        FW_OObjectRegistry* objectRegistry = 0,
  45.                        int numberFormat = FW_kStream_NativeEndian);
  46.     FW_CReadableStream(FW_HReadableStream hStream);
  47.     ~FW_CReadableStream();
  48.  
  49.     operator    FW_HReadableStream();
  50.     FW_OSink*    GetSink() const;
  51.     FW_OObjectRegistry*    GetRegistry() const;
  52.  
  53.     // ----- void
  54.     
  55.     void Read(void* buffer, long count);
  56.         // Read 'count' bytes into buffer.
  57.  
  58.     // ----- char
  59.     
  60.     void Read(char* buffer, long count);
  61.         // Read 'count' chars into buffer.
  62.  
  63.     char GetChar();
  64.         // Get char.
  65.  
  66.     // ----- signed char
  67.     
  68.     void Read(signed char* buffer, long count);
  69.         // Read 'count' signed chars into buffer.
  70.  
  71.     signed char GetSignedChar();
  72.         // Get signed char.
  73.  
  74.     // ----- unsigned char
  75.     
  76.     void Read(unsigned char* buffer, long count);
  77.         // Read 'count' unsigned chars into buffer.
  78.  
  79.     unsigned char GetUnsignedChar();
  80.         // Get unsigned char.
  81.  
  82.     // ----- short
  83.  
  84.     void Read(short* buffer, long count);
  85.         // Read 'count' shorts into buffer.
  86.  
  87.     short GetShort();
  88.         // Get short.
  89.  
  90.     // ----- unsigned short
  91.  
  92.     void Read(unsigned short* buffer, long count);
  93.         // Read 'count' unsigned shorts into buffer.
  94.  
  95.     unsigned short GetUnsignedShort();
  96.         // Get unsigned short.
  97.  
  98.     // ----- long
  99.  
  100.     void Read(long* buffer, long count);
  101.         // Read 'count' longs into buffer.
  102.  
  103.     long GetLong();
  104.         // Get long.
  105.  
  106.     // ----- unsigned long
  107.  
  108.     void Read(unsigned long* buffer, long count);
  109.         // Read 'count' unsigned longs into buffer.
  110.  
  111.     unsigned long GetUnsignedLong();
  112.         // Get unsigned long.
  113.  
  114.     // ----- int
  115.  
  116.     void Read(int* buffer, long count);
  117.         // Read 'count' ints into buffer.
  118.  
  119.     int GetInt();
  120.         // Get int.
  121.  
  122.     // ----- unsigned int
  123.  
  124.     void Read(unsigned int* buffer, long count);
  125.         // Read 'count' unsigned ints into buffer.
  126.  
  127.     unsigned int GetUnsignedInt();
  128.         // Get unsigned int.
  129.  
  130.     // ----- float
  131.  
  132.     void Read(float* buffer, long count);
  133.         // Read 'count' floats into buffer.
  134.  
  135.     float GetFloat();
  136.         // Get float.
  137.  
  138.     // ----- double
  139.  
  140.     void Read(double* buffer, long count);
  141.         // Read 'count' doubles into buffer.
  142.  
  143.     double GetDouble();
  144.         // Get double.
  145.         
  146. private:
  147.     FW_CReadableStream(const FW_CReadableStream& theStream);
  148.     FW_CReadableStream& operator=(const FW_CReadableStream& theStream);
  149.         // Can't copy instances of this class.
  150.     FW_CReadableStream(const FW_SReadableStream& readableStream);
  151. };
  152.  
  153. //----------------------------------------------------------------------------------------
  154. // inline operator >>
  155. //----------------------------------------------------------------------------------------
  156.  
  157. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, char& aChar)
  158. {
  159.     ::FW_FailOnError(FW_PrivReadableStream_ReadChars(&s, &aChar, 1));
  160.     return s;
  161. }
  162.  
  163. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, char* nullTerminatedString)
  164. {
  165.     ::FW_FailOnError(FW_PrivReadableStream_ReadNullTerminatedString(&s, nullTerminatedString));
  166.     return s;
  167. }
  168.  
  169. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, signed char& signedChar)
  170. {
  171.     ::FW_FailOnError(FW_PrivReadableStream_ReadChars(&s, (char*) &signedChar, 1));
  172.     return s;
  173. }
  174.  
  175. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, unsigned char& unsignedChar)
  176. {
  177.     ::FW_FailOnError(FW_PrivReadableStream_ReadChars(&s, (char*) &unsignedChar, 1));
  178.     return s;
  179. }
  180.  
  181. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, short& aShort)
  182. {
  183.     ::FW_FailOnError(FW_PrivReadableStream_ReadShorts(&s, &aShort, 1));
  184.     return s;
  185. }
  186.  
  187. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, unsigned short& unsignedShort)
  188. {
  189.     ::FW_FailOnError(FW_PrivReadableStream_ReadShorts(&s, (short*) &unsignedShort, 1));
  190.     return s;
  191. }
  192.  
  193. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, long& aLong)
  194. {
  195.     ::FW_FailOnError(FW_PrivReadableStream_ReadLongs(&s, &aLong, 1));
  196.     return s;
  197. }
  198.  
  199. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, unsigned long& unsignedLong)
  200. {
  201.     ::FW_FailOnError(FW_PrivReadableStream_ReadLongs(&s, (long*) &unsignedLong, 1));
  202.     return s;
  203. }
  204.  
  205. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, int& aInt)
  206. {
  207.     ::FW_FailOnError(FW_PrivReadableStream_ReadInts(&s, &aInt, 1));
  208.     return s;
  209. }
  210.  
  211. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, unsigned int& unsignedInt)
  212. {
  213.     ::FW_FailOnError(FW_PrivReadableStream_ReadInts(&s, (int*) &unsignedInt, 1));
  214.     return s;
  215. }
  216.  
  217. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, float& aFloat)
  218. {
  219.     ::FW_FailOnError(FW_PrivReadableStream_ReadFloats(&s, &aFloat, 1));
  220.     return s;
  221. }
  222.  
  223. inline FW_CReadableStream& operator>>(FW_CReadableStream& s, double& aDouble)
  224. {
  225.     ::FW_FailOnError(FW_PrivReadableStream_ReadDoubles(&s, &aDouble, 1));
  226.     return s;
  227. }
  228.  
  229. //----------------------------------------------------------------------------------------
  230. // FW_CReadableStream::GetSink
  231. //----------------------------------------------------------------------------------------
  232.  
  233. inline FW_OSink* FW_CReadableStream::GetSink() const
  234. {
  235.     return fSink;
  236. }
  237.  
  238. //----------------------------------------------------------------------------------------
  239. // FW_CReadableStream::GetRegistry
  240. //----------------------------------------------------------------------------------------
  241.  
  242. inline FW_OObjectRegistry* FW_CReadableStream::GetRegistry() const
  243. {
  244.     return fObjectRegistry;
  245. }
  246.  
  247. //----------------------------------------------------------------------------------------
  248. // FW_CReadableStream::operator    FW_HReadableStream
  249. //----------------------------------------------------------------------------------------
  250.  
  251. inline FW_CReadableStream::operator    FW_HReadableStream()
  252. {
  253.     return this;
  254. }
  255.  
  256. //----------------------------------------------------------------------------------------
  257. // FW_CReadableStream::Read
  258. //----------------------------------------------------------------------------------------
  259.  
  260. inline void FW_CReadableStream::Read(void* buffer, long count)
  261. {
  262.     ::FW_FailOnError(FW_PrivReadableStream_ReadBytes(this, buffer, count));
  263. }
  264.  
  265. //----------------------------------------------------------------------------------------
  266. // FW_CReadableStream::Read
  267. //----------------------------------------------------------------------------------------
  268.  
  269. inline void FW_CReadableStream::Read(char* buffer, long count)
  270. {
  271.     ::FW_FailOnError(FW_PrivReadableStream_ReadChars(this, buffer, count));
  272. }
  273.  
  274. //----------------------------------------------------------------------------------------
  275. // FW_CReadableStream::GetChar
  276. //----------------------------------------------------------------------------------------
  277.  
  278. inline char FW_CReadableStream::GetChar()
  279. {
  280.     char x;
  281.     *this >> x;
  282.     return x;
  283. }
  284.  
  285. //----------------------------------------------------------------------------------------
  286. // FW_CReadableStream::Read
  287. //----------------------------------------------------------------------------------------
  288.  
  289. inline void FW_CReadableStream::Read(signed char* buffer, long count)
  290. {
  291.     Read((char*) buffer, count);
  292. }
  293.  
  294. //----------------------------------------------------------------------------------------
  295. // FW_CReadableStream::GetSignedChar
  296. //----------------------------------------------------------------------------------------
  297.  
  298. inline signed char FW_CReadableStream::GetSignedChar()
  299. {
  300.     return (signed char)GetChar();
  301. }
  302.  
  303. //----------------------------------------------------------------------------------------
  304. // FW_CReadableStream::Read
  305. //----------------------------------------------------------------------------------------
  306.  
  307. inline void FW_CReadableStream::Read(unsigned char* buffer, long count)
  308. {
  309.     Read((char*) buffer, count);
  310. }
  311.  
  312. //----------------------------------------------------------------------------------------
  313. // FW_CReadableStream::GetUnsignedChar
  314. //----------------------------------------------------------------------------------------
  315.  
  316. inline unsigned char FW_CReadableStream::GetUnsignedChar()
  317. {
  318.     return (unsigned char)GetChar();
  319. }
  320.  
  321. //----------------------------------------------------------------------------------------
  322. // FW_CReadableStream::Read
  323. //----------------------------------------------------------------------------------------
  324.  
  325. inline void FW_CReadableStream::Read(short* buffer, long count)
  326. {
  327.     ::FW_FailOnError(FW_PrivReadableStream_ReadShorts(this, buffer, count));
  328. }
  329.  
  330. //----------------------------------------------------------------------------------------
  331. // FW_CReadableStream::GetShort
  332. //----------------------------------------------------------------------------------------
  333.  
  334. inline short FW_CReadableStream::GetShort()
  335. {
  336.     short x;
  337.     *this >> x;
  338.     return x;
  339. }
  340.  
  341. //----------------------------------------------------------------------------------------
  342. // FW_CReadableStream::Read
  343. //----------------------------------------------------------------------------------------
  344.  
  345. inline void FW_CReadableStream::Read(unsigned short* buffer, long count)
  346. {
  347.     Read((short*) buffer, count);
  348. }
  349.  
  350. //----------------------------------------------------------------------------------------
  351. // FW_CReadableStream::GetUnsignedShort
  352. //----------------------------------------------------------------------------------------
  353.  
  354. inline unsigned short FW_CReadableStream::GetUnsignedShort()
  355. {
  356.     return (unsigned short) GetShort();
  357. }
  358.  
  359. //----------------------------------------------------------------------------------------
  360. // FW_CReadableStream::Read
  361. //----------------------------------------------------------------------------------------
  362.  
  363. inline void FW_CReadableStream::Read(long* buffer, long count)
  364. {
  365.     ::FW_FailOnError(FW_PrivReadableStream_ReadLongs(this, buffer, count));
  366. }
  367.  
  368. //----------------------------------------------------------------------------------------
  369. // FW_CReadableStream::GetLong
  370. //----------------------------------------------------------------------------------------
  371.  
  372. inline long FW_CReadableStream::GetLong()
  373. {
  374.     long x;
  375.     *this >> x;
  376.     return x;
  377. }
  378.  
  379. //----------------------------------------------------------------------------------------
  380. // FW_CReadableStream::Read
  381. //----------------------------------------------------------------------------------------
  382.  
  383. inline void FW_CReadableStream::Read(unsigned long* buffer,
  384.                                      long count)
  385. {
  386.     Read((long*) buffer, count);
  387. }
  388.  
  389. //----------------------------------------------------------------------------------------
  390. // FW_CReadableStream::GetUnsignedLong
  391. //----------------------------------------------------------------------------------------
  392.  
  393. inline unsigned long FW_CReadableStream::GetUnsignedLong()
  394. {
  395.     return (unsigned long) GetLong();
  396. }
  397.  
  398. //----------------------------------------------------------------------------------------
  399. // FW_CReadableStream::Read
  400. //----------------------------------------------------------------------------------------
  401.  
  402. inline void FW_CReadableStream::Read(int* buffer, long count)
  403. {
  404.     ::FW_FailOnError(FW_PrivReadableStream_ReadInts(this, buffer, count));
  405. }
  406.  
  407. //----------------------------------------------------------------------------------------
  408. // FW_CReadableStream::GetInt
  409. //----------------------------------------------------------------------------------------
  410.  
  411. inline int FW_CReadableStream::GetInt()
  412. {
  413.     int x;
  414.     *this >> x;
  415.     return x;
  416. }
  417.  
  418. //----------------------------------------------------------------------------------------
  419. // FW_CReadableStream::Read
  420. //----------------------------------------------------------------------------------------
  421.  
  422. inline void FW_CReadableStream::Read(unsigned int* buffer, long count)
  423. {
  424.     Read((int*) buffer, count);
  425. }
  426.  
  427. //----------------------------------------------------------------------------------------
  428. // FW_CReadableStream::GetUnsignedInt
  429. //----------------------------------------------------------------------------------------
  430.  
  431. inline unsigned int FW_CReadableStream::GetUnsignedInt()
  432. {
  433.     return (unsigned int)GetInt();
  434. }
  435.  
  436. //----------------------------------------------------------------------------------------
  437. // FW_CReadableStream::Read
  438. //----------------------------------------------------------------------------------------
  439.  
  440. inline void FW_CReadableStream::Read(float* buffer, long count)
  441. {
  442.     ::FW_FailOnError(FW_PrivReadableStream_ReadFloats(this, buffer, count));
  443. }
  444.  
  445. //----------------------------------------------------------------------------------------
  446. // FW_CReadableStream::GetFloat
  447. //----------------------------------------------------------------------------------------
  448.  
  449. inline float FW_CReadableStream::GetFloat()
  450. {
  451.     float x;
  452.     *this >> x;
  453.     return x;
  454. }
  455.  
  456. //----------------------------------------------------------------------------------------
  457. // FW_CReadableStream::Read
  458. //----------------------------------------------------------------------------------------
  459.  
  460. inline void FW_CReadableStream::Read(double* buffer, long count)
  461. {
  462.     ::FW_FailOnError(FW_PrivReadableStream_ReadDoubles(this, buffer, count));
  463. }
  464.  
  465. //----------------------------------------------------------------------------------------
  466. // FW_CReadableStream::GetDouble
  467. //----------------------------------------------------------------------------------------
  468.  
  469. inline double FW_CReadableStream::GetDouble()
  470. {
  471.     double x;
  472.     *this >> x;
  473.     return x;
  474. }
  475.  
  476. //========================================================================================
  477. //    CLASS FW_CWritableStream
  478. //========================================================================================
  479.  
  480. class FW_CWritableStream : public FW_SWritableStream
  481. {
  482. public:
  483.  
  484.     FW_DECLARE_AUTO(FW_CWritableStream)
  485.  
  486.     FW_CWritableStream(FW_OSink* sink,
  487.                        FW_OObjectRegistry* objectRegistry = 0,
  488.                        int numberFormat = FW_kStream_NativeEndian);
  489.     FW_CWritableStream(FW_HWritableStream hStream);
  490.     ~FW_CWritableStream();
  491.  
  492.     operator    FW_HWritableStream();
  493.     FW_OSink*    GetSink() const;
  494.     FW_OObjectRegistry*    GetRegistry() const;
  495.     
  496.     // ----- void
  497.     
  498.     void Write(const void* buffer, long count);
  499.         // Write 'count' bytes from buffer.
  500.  
  501.     // ----- char
  502.     
  503.     void Write(const char* buffer, long count);
  504.         // Write 'count' chars from buffer.
  505.  
  506.     // ----- signed char
  507.     
  508.     void Write(const signed char* buffer, long count);
  509.         // Write 'count' signed chars from buffer.
  510.  
  511.     // ----- unsigned char
  512.     
  513.     void Write(const unsigned char* buffer, long count);
  514.         // Write 'count' unsigned chars from buffer.
  515.  
  516.     // ----- short
  517.  
  518.     void Write(const short* buffer, long count);
  519.         // Write 'count' shorts from buffer.
  520.  
  521.     // ----- unsigned short
  522.  
  523.     void Write(const unsigned short* buffer, long count);
  524.         // Write 'count' unsigned shorts from buffer.
  525.  
  526.     // ----- long
  527.  
  528.     void Write(const long* buffer, long count);
  529.         // Write 'count' longs from buffer.
  530.  
  531.     // ----- unsigned long
  532.  
  533.     void Write(const unsigned long* buffer, long count);
  534.         // Write 'count' unsigned longs from buffer.
  535.  
  536.     // ----- int
  537.  
  538.     void Write(const int* buffer, long count);
  539.         // Write 'count' ints from buffer.
  540.  
  541.     // ----- unsigned int
  542.  
  543.     void Write(const unsigned int* buffer, long count);
  544.         // Write 'count' unsigned ints from buffer.
  545.  
  546.     // ----- float
  547.  
  548.     void Write(const float* buffer, long count);
  549.         // Write 'count' floats from buffer.
  550.  
  551.     // ----- double
  552.  
  553.     void Write(const double* buffer, long count);
  554.         // Write 'count' doubles from buffer.
  555.  
  556. private:
  557.     FW_CWritableStream(const FW_CWritableStream& theStream);
  558.     FW_CWritableStream& operator=(const FW_CWritableStream& theStream);
  559.         // Can't copy instances of this class.
  560.     FW_CWritableStream(const FW_SWritableStream& writableStream);
  561. };
  562.  
  563.  
  564. //----------------------------------------------------------------------------------------
  565. // inline operator <<
  566. //----------------------------------------------------------------------------------------
  567.  
  568. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, char aChar)
  569. {
  570.     ::FW_FailOnError(FW_PrivWritableStream_WriteChars(&s, &aChar, 1));
  571.     return s;
  572. }
  573.  
  574. inline FW_CWritableStream& operator<<(FW_CWritableStream& s,  char *nullTerminatedString)
  575. {
  576.     ::FW_FailOnError(FW_PrivWritableStream_WriteNullTerminatedString(&s, nullTerminatedString));
  577.     return s;
  578. }
  579.  
  580. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, signed char signedChar)
  581. {
  582.     ::FW_FailOnError(FW_PrivWritableStream_WriteChars(&s, (const char*) &signedChar, 1));
  583.     return s;
  584. }
  585.  
  586. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, unsigned char unsignedChar)
  587. {
  588.     ::FW_FailOnError(FW_PrivWritableStream_WriteChars(&s, (const char*) &unsignedChar, 1));
  589.     return s;
  590. }
  591.  
  592. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, short aShort)
  593. {
  594.     ::FW_FailOnError(FW_PrivWritableStream_WriteShorts(&s, &aShort, 1));
  595.     return s;
  596. }
  597.  
  598. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, unsigned short unsignedShort)
  599. {
  600.     ::FW_FailOnError(FW_PrivWritableStream_WriteShorts(&s, (const short*) &unsignedShort, 1));
  601.     return s;
  602. }
  603.  
  604. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, long aLong)
  605. {
  606.     ::FW_FailOnError(FW_PrivWritableStream_WriteLongs(&s, &aLong, 1));
  607.     return s;
  608. }
  609.  
  610. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, unsigned long unsignedLong)
  611. {
  612.     ::FW_FailOnError(FW_PrivWritableStream_WriteLongs(&s, (const long*) &unsignedLong, 1));
  613.     return s;
  614. }
  615.  
  616. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, int aInt)
  617. {
  618.     ::FW_FailOnError(FW_PrivWritableStream_WriteInts(&s, &aInt, 1));
  619.     return s;
  620. }
  621.  
  622. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, unsigned int unsignedInt)
  623. {
  624.     ::FW_FailOnError(FW_PrivWritableStream_WriteInts(&s, (const int*) &unsignedInt, 1));
  625.     return s;
  626. }
  627.  
  628. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, float aFloat)
  629. {
  630.     ::FW_FailOnError(FW_PrivWritableStream_WriteFloats(&s, &aFloat, 1));
  631.     return s;
  632. }
  633.  
  634. inline FW_CWritableStream& operator<<(FW_CWritableStream& s, double aDouble)
  635. {
  636.     ::FW_FailOnError(FW_PrivWritableStream_WriteDoubles(&s, &aDouble, 1));
  637.     return s;
  638. }
  639.  
  640. //----------------------------------------------------------------------------------------
  641. // FW_CWritableStream::GetSink
  642. //----------------------------------------------------------------------------------------
  643.  
  644. inline FW_OSink* FW_CWritableStream::GetSink() const
  645. {
  646.     return fSink;
  647. }
  648.  
  649. //----------------------------------------------------------------------------------------
  650. // FW_CWritableStream::GetRegistry
  651. //----------------------------------------------------------------------------------------
  652.  
  653. inline FW_OObjectRegistry* FW_CWritableStream::GetRegistry() const
  654. {
  655.     return fObjectRegistry;
  656. }
  657.  
  658. //----------------------------------------------------------------------------------------
  659. // FW_CWritableStream::operator    FW_HWritableStream
  660. //----------------------------------------------------------------------------------------
  661.  
  662. inline FW_CWritableStream::operator    FW_HWritableStream()
  663. {
  664.     return this;
  665. }
  666.  
  667. //----------------------------------------------------------------------------------------
  668. // FW_CWritableStream::Write
  669. //----------------------------------------------------------------------------------------
  670.  
  671. inline void FW_CWritableStream::Write(const void* buffer, long count)
  672. {
  673.     ::FW_FailOnError(FW_PrivWritableStream_WriteBytes(this, buffer, count));
  674. }
  675.  
  676. //----------------------------------------------------------------------------------------
  677. // FW_CWritableStream::Write
  678. //----------------------------------------------------------------------------------------
  679.  
  680. inline void FW_CWritableStream::Write(const char* buffer, long count)
  681. {
  682.     ::FW_FailOnError(FW_PrivWritableStream_WriteChars(this, buffer, count));
  683. }
  684.  
  685. //----------------------------------------------------------------------------------------
  686. // FW_CWritableStream::Write
  687. //----------------------------------------------------------------------------------------
  688.  
  689. inline void FW_CWritableStream::Write(const signed char* buffer, long count)
  690. {
  691.     Write((const char*) buffer, count);
  692. }
  693.  
  694. //----------------------------------------------------------------------------------------
  695. // FW_CWritableStream::Write
  696. //----------------------------------------------------------------------------------------
  697.  
  698. inline void FW_CWritableStream::Write(const unsigned char* buffer, long count)
  699. {
  700.     Write((const char*) buffer, count);
  701. }
  702.  
  703. //----------------------------------------------------------------------------------------
  704. // FW_CWritableStream::Write
  705. //----------------------------------------------------------------------------------------
  706.  
  707. inline void FW_CWritableStream::Write(const short* buffer, long count)
  708. {
  709.     ::FW_FailOnError(FW_PrivWritableStream_WriteShorts(this, buffer, count));
  710. }
  711.  
  712. //----------------------------------------------------------------------------------------
  713. // FW_CWritableStream::Write
  714. //----------------------------------------------------------------------------------------
  715.  
  716. inline void FW_CWritableStream::Write(const unsigned short* buffer, long count)
  717. {
  718.     Write((const short*) buffer, count);
  719. }
  720.  
  721. //----------------------------------------------------------------------------------------
  722. // FW_CWritableStream::Write
  723. //----------------------------------------------------------------------------------------
  724.  
  725. inline void FW_CWritableStream::Write(const long* buffer, long count)
  726. {
  727.     ::FW_FailOnError(FW_PrivWritableStream_WriteLongs(this, buffer, count));
  728. }
  729.  
  730. //----------------------------------------------------------------------------------------
  731. // FW_CWritableStream::Write
  732. //----------------------------------------------------------------------------------------
  733.  
  734. inline void FW_CWritableStream::Write(const unsigned long* buffer, long count)
  735. {
  736.     Write((const long*) buffer, count);
  737. }
  738.  
  739. //----------------------------------------------------------------------------------------
  740. // FW_CWritableStream::Write
  741. //----------------------------------------------------------------------------------------
  742.  
  743. inline void FW_CWritableStream::Write(const int* buffer, long count)
  744. {
  745.     ::FW_FailOnError(FW_PrivWritableStream_WriteInts(this, buffer, count));
  746. }
  747.  
  748. //----------------------------------------------------------------------------------------
  749. // FW_CWritableStream::Write
  750. //----------------------------------------------------------------------------------------
  751.  
  752. inline void FW_CWritableStream::Write(const unsigned int* buffer, long count)
  753. {
  754.     Write((const int*) buffer, count);
  755. }
  756.  
  757. //----------------------------------------------------------------------------------------
  758. // FW_CWritableStream::Write
  759. //----------------------------------------------------------------------------------------
  760.  
  761. inline void FW_CWritableStream::Write(const float* buffer, long count)
  762. {
  763.     ::FW_FailOnError(FW_PrivWritableStream_WriteFloats(this, buffer, count));
  764. }
  765.  
  766. //----------------------------------------------------------------------------------------
  767. // FW_CWritableStream::Write
  768. //----------------------------------------------------------------------------------------
  769.  
  770. inline void FW_CWritableStream::Write(const double* buffer, long count)
  771. {
  772.     ::FW_FailOnError(FW_PrivWritableStream_WriteDoubles(this, buffer, count));
  773. }
  774.  
  775. #endif
  776.